\magnification = \magstep3

\font\titlefont=cmbx10 scaled \magstep3 
\font\sectionfont=cmr10 scaled \magstep2
\font\magone=cmr10 scaled \magstep1
\font\magonebf=cmbx10 scaled \magstep1 
\font\magtwo=cmr10 scaled \magstep2
\font\magtwobf=cmbx10 scaled \magstep2 
\font\magthree=cmr10 scaled \magstep3
\font\magthreebf=cmbx10 scaled \magstep3 
\font\magfour=cmr10 scaled \magstep4
\font\magfourbf=cmbx10 scaled \magstep4 
%
\font\bigone=cmr10 scaled \magstep1
\font\bigtwo=cmr10 scaled \magstep2
\font\bigthree=cmr10 scaled \magstep3
\font\bigfour=cmr10 scaled \magstep4

\hsize=16truecm
\vsize=24.5truecm


\hoffset= 0truecm   
\voffset= 0.3truecm 
%\hoffset= 1.9truecm  
%\voffset= 2truecm

\parindent 0pt
\parskip 8pt plus 1pt minus 1pt 
%

\smallskip
\#include $<$LEDA/dictionary.h$>$
\smallskip
{\bf declare2}(dictionary, string, int)
\smallskip
\cleartabs
\+main()\cr
\+$\{$\ \ &\cr
\+  &dictionary(string, int) $D$;\cr
\smallskip
\+  &string $s$;\cr
\+  &dic\_item $it$;\cr
\smallskip
\+  &{\bf while} &( (cin $>> s$) \&\& ($s$ != ``stop'') )\cr
\+  &\ \  &$\{$ &$it = D$.lookup($s$);\cr
\+  &     &    &if ($it==nil$) $D$.insert($s,1$);\cr
\+  &     &    &else $D$.change\_inf($it$,$D$.inf($it$)+1);\cr
\+  &     &\ $\}$\cr
\smallskip
\+  &{\bf forall\_items}($it,D$) 
cout $<< D$.key($it$) $<<$ `` : " $<<$  $D$.inf($it$) $<<$ ``$\backslash$n";\cr
\smallskip
\+\ $\}$\cr

\bye
